﻿using System.Collections.Generic;
using Ops.Host.Core.Models;
using Ops.Host.Core.Services;

namespace Ops.Host.App.ViewModels;

public sealed class CardSwipingViewModel : SinglePagedViewModelBase<CardSwiping, CardSwipingFilter>
{
    private readonly ICardSwipingService _cardSwipingService;

    public CardSwipingViewModel(ICardSwipingService cardSwipingService)
    {
        _cardSwipingService = cardSwipingService;

        InitSearch();
    }

    public override string DownloadFileName()
    {
        return "刷卡信息" + base.DownloadFileName();
    }

    protected override (IEnumerable<CardSwiping> items, long pageCount) OnSearch(int pageIndex, int pageSize)
    {
        return _cardSwipingService.GetPaged(QueryFilter, pageIndex, pageSize);
    }
}
